﻿<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="wfAgregarProducto.aspx.cs" Inherits="WebGustozzi.ModuloVentas.wfAgregarProducto" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Aplicación Web Gustozzi</title>
    <link href="//App_Themes/SkinFile/StyleSheet.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../SCRIPT/ManejarControles.js"></script> 
    <script type="text/javascript" src="../SCRIPT/DialogosMaster.js"></script> 
    <script type="text/javascript">

          function cerrar() {
            window.close();
          }

          function volverValor() {
              window.opener.document.getElementById('CPHPrincipal_hdfNumItems').value = window.document.getElementById("hdfCantidadItems");
              window.close();
          }

        function AbrirModalPopup(nombrePagina, ancho, alto) {
            var atributos = 'dialogWidth:' + ancho + 'px' + ';dialogHeight:' + alto + 'px' + ';status:no;resizable:no;scroll:yes;center:yes';
            window.showModalDialog(nombrePagina, self, atributos);
            return false;
        }

        if (window.dialogArguments) {
            window.opener = window.dialogArguments;
        }

        function BuscarProducto() {
            AbrirModalPopup('wfBuscarProducto.aspx', 850, 400);
        }

        function validaDecimal(pControl, pForm, pTexto) {
            if (vacio(document.getElementById(pControl).value) == true) {
                return true;
            } else {
                if (!/^([0-9])*[.]?[0-9]*$/.test(numero)) {
                    return true;
                } else {
                    showPopupInformar(2, pForm, pTexto, pControl);
                    return false;
                }
            }
        }

    </script>
    <style type="text/css">
        .style1
        {}
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server"><contenttemplate> 

        <div class="popup_Container">
        <div class="popup_Titlebar" id="PopupHeader">
            <div class="TitlebarLeft">            
                <%--Titulo--%>
                  <table style="width:100%" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td >
                            <asp:Label id="Label12" runat="server" Text=":: AGREGAR PRODUCTO" 
                                SkinID="labelTitulo"></asp:Label>
                        </td>
                    </tr>    
                    <tr>
                        <td style="HEIGHT: 10px"></td>
                    </tr>
                </table>
            </div>
            <div class="TitlebarRight" onclick="cancel();">
            </div>
        </div>
        <div class="popupBusqueda">
        <div id="contenedor2">
        <asp:HiddenField ID="hdf_InicioGrilla" runat="server"/>
    
            <asp:HiddenField ID="hdfCantidadItems" runat="server" />
    
        <%--Datos del Busqueda--%>
        <table style="width:100%" cellpadding="0" cellspacing="0" border="0" class="tdmarcoTitulo">
            <tr>
                <td colspan="14">
                <table style="width:100%" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td class="tdfondoTitulo" style="width:100%; HEIGHT: 18px" align="left">
                            <asp:Label ID="Label1" runat="server" SkinID="labelsubTituloSkin"  
                                Text=" :: Datos Producto" Width="230px"></asp:Label>
                        </td>
                    </tr>
                </table>
                </td>
            </tr>
            <tr style="height:10px"><td colspan="14"></td></tr>
           <tr>
                <td  style="width:10px; height: 26px;">
                </td>
                <td  style="width:70px" >
                    <asp:Label ID="Label10" runat="server" Text="Tipo" SkinID="labelTextSkin" 
                        Width="30px"></asp:Label>
                <td colspan="3" >
                    <asp:RadioButtonList ID="rblTipo" runat="server" 
                        RepeatDirection="Horizontal" SkinID="RadioButtonTextSkin" Width="160px" 
                        onselectedindexchanged="rblTipo_SelectedIndexChanged" Height="17px" 
                        AutoPostBack="True">
                        <asp:ListItem Selected="True" Value="1">Producto</asp:ListItem>
                        <asp:ListItem Value="2">Promoción</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
                <td  style="width:100px">
                </td>
                <td  style="width:50px">
                </td>
                <td colspan="2">
                </td >
                <td  style="width:40px">
                </td>
                <td colspan="2" >
                </td>
                    <td width="20px">
                        &nbsp;</td>
                    <td width="20px">
                        &nbsp;</td>
            </tr>
            <div id="divPromocion" runat="server" visible="false">
            <tr>
                <td  style="width:10px; height: 26px;">
                </td>
                <td>
                    <asp:Label ID="Label7" runat="server" Text="Categoria" SkinID="labelTextSkin" 
                        Width="70px"></asp:Label>
                </td>
                <td colspan="3">

                    <asp:DropDownList ID="ddlCategoria" runat="server" 
                        SkinID="DropDownListTextSkin" Width="161px" 
                        AppendDataBoundItems="True" AutoPostBack="True" 
                        onselectedindexchanged="ddlCategoria_SelectedIndexChanged">
                        <asp:ListItem Value="">--Seleccionar--</asp:ListItem>
                    </asp:DropDownList>

                </td>
                <td style="width:100px" align="right">
                    <asp:Label ID="Label11" runat="server" Height="16px" SkinID="labelTextSkin" 
                        Text="Producto" Width="50px"></asp:Label>&nbsp;
                </td>
                <td colspan="6">
                    <asp:DropDownList ID="ddlProductoCategoria" runat="server" 
                        onselectedindexchanged="ddlProductoCategoria_SelectedIndexChanged" 
                        SkinID="DropDownListTextSkin" Width="186px" AutoPostBack="True" 
                        AppendDataBoundItems="True" style="height: 19px">
                        <asp:ListItem Value="">--Seleccionar--</asp:ListItem>
                    </asp:DropDownList>
                </td >
                <td></td>
                <td>
                    &nbsp;</td>
            </tr>
            </div>
            <div id="divProducto" runat="server" visible="true">
            <tr>
                <td  style="width:10px; height: 26px;">
                </td>
                <td >
                    <asp:Label ID="Label2" runat="server" Text="Promoción" SkinID="labelTextSkin" 
                        Width="70px"></asp:Label>
                </td>
                <td colspan="7">
                    <asp:DropDownList ID="ddlPromocion" runat="server" 
                        SkinID="DropDownListTextSkin" Width="250px" 
                        onselectedindexchanged="ddlPromocion_SelectedIndexChanged" 
                        AutoPostBack="True" AppendDataBoundItems="True">
                        <asp:ListItem Value="">--Seleccionar--</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td >
                </td>
                <td colspan="2">
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            </div>
            <tr>
                <td  style="width:10px; height: 26px;">
                </td>
                <td >
                    <asp:Label ID="Label4" runat="server" Text="Precio Unit." SkinID="labelTextSkin" 
                        Width="70px"></asp:Label>
                </td>
                <td style="width:70px">
                    <asp:TextBox ID="txtPreUnit" runat="server" SkinID="CajaTextoSkinNum" 
                        Width="50px" ontextchanged="txtPreUnit_TextChanged"></asp:TextBox>
                </td>
                <td align="right">
                    <asp:Label ID="Label6" runat="server" SkinID="labelTextSkin" Text="Unidad"></asp:Label>
                    &nbsp;</td>
                <td colspan="2">
                    <asp:TextBox ID="txtUnidad" runat="server" 
                        SkinID="CajaTextoBloqueadoSkin" Width="50px" ReadOnly="True"></asp:TextBox>
                </td>
                <td align="right" width="60px">
                    <div ID="divPromo2" runat="server" visible="true">
                        <asp:Label ID="Label8" runat="server" SkinID="labelTextSkin" Text="Cantidad"></asp:Label>
                        &nbsp;</div>
                </td>
                <td>
                    <asp:TextBox ID="txtCantidad" runat="server" 
                            SkinID="CajaTextoSkinNum" Width="50px" 
                        ontextchanged="txtCantidad_TextChanged" style="margin-top: 5px" 
                        AutoPostBack="True"></asp:TextBox>
                </td>
                <td colspan="2">
                    &nbsp;</td>
                <td align="right" width="170px" >
                    <asp:Label ID="Label9" runat="server" SkinID="labelTextSkin" 
                        Text="Monto Total S/."></asp:Label>
                    &nbsp;</td>
                <td class="style1" colspan="2">
                    <asp:TextBox ID="txtTotal" runat="server" 
                        SkinID="CajaTextoBloqueadoSkin" Width="40px" style="margin-bottom: 0px"></asp:TextBox>
                </td>
                <td class="style1">
                    &nbsp;</td>
            </tr>
            <tr><td style="height:5px"></td></tr>
        </table>
        <table>
            <tr style="height:10px"><td></td></tr>
        </table>

        <div id="divMensaje" runat="server" visible="false" >
        <table style="width:100%" cellpadding="0" cellspacing="0" border="0">
            <tr><td align="center">
                    <asp:Label ID="lblMsj" runat="server" SkinID="labelMessageSkin"></asp:Label>
            </td></tr>
        </table>
        </div>

        <%--Controles de comando--%>
        <table>
            <tr>
                <td style="height:26px" align="left" >
                    &nbsp;<asp:ImageButton 
                        ID="imbAceptar" runat="server" 
                        ImageUrl="~/imagenes/bn_Aceptar.jpg" 
                        ToolTip="Aceptar" onclick="imbAceptar_Click" />
                    &nbsp;<asp:ImageButton ID="imbCerrar" runat="server" 
                        ImageUrl="~/imagenes/bn_cerrar.jpg" 
                        ToolTip="Nuevo Producto" onclientclick="cerrar()"  />
            </td></tr>
        </table>

        <table>
            <tr style="height:10px"><td>
                </td></tr>
        </table>
       </div>
        </div>        
    </div>

    </contenttemplate> </asp:UpdatePanel>

    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlConfirmar" runat="server" BackColor="White" BorderColor="Maroon"
                BorderStyle="Solid" BorderWidth="2px" Height="130px" Style="display: none" Width="350px">
                <table align="center" border="0" cellspacing="0" style="width: 100%; height: 100%">
                    <tr style="color: white; height: 20%">
                        <th id="backTitulo" align="left" class="modalConfirmar_Titulo" colspan="2" style="height: 20%;
                            background-color: #a71b1b" valign="middle">
                            <asp:Label ID="lblMsgConfirmacion" runat="server" Text="Titulo"></asp:Label>
                        </th>
                    </tr>
                    <tr style="height: 50%">
                        <td style="width: 60px">
                            <img id="imgDialogo" runat="server" alt="" src="imagenes/msg_informacion.JPG" />
                        </td>
                        <td align="left" valign="middle">
                            <asp:Button ID="btnConfirmar" runat="server" Style="display: none" Text="Confirm" />
                            <asp:Label ID="lblMsgConfirmacionMensaje" runat="server" Font-Names="Calibri" Font-Size="11pt"
                                Text="Mensaje de la Ventana"></asp:Label>
                        </td>
                    </tr>
                    <tr style="height: 30%">
                        <td align="center" colspan="2">
                            <asp:Button ID="btnConfirmAceptar" runat="server" Text="Si" />
                            <asp:Button ID="btnConfirmCancela" runat="server" OnClientClick="salirConEnfoque()"
                                Text="No" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                <ContentTemplate>
                    <input id="hconfirm" runat="server" type="hidden" />
                    <asp:HiddenField ID="henfoque" runat="server" />
                </ContentTemplate>
            </asp:UpdatePanel>
            <cc1:ModalPopupExtender ID="mpeConfirmacion" runat="server" BackgroundCssClass="modalBackground"
                BehaviorID="mpeConfirmacionJS" CancelControlID="btnConfirmCancela" PopupControlID="pnlConfirmar"
                TargetControlID="btnConfirmar">
            </cc1:ModalPopupExtender>
        </ContentTemplate>
    </asp:UpdatePanel>

    </form>
</body>
</html>
